#!/usr/bin/env python3
# config.py
# 全局配置：协议、端口、超时等
import os

# 全局开关
IF_VISUALIZE = True  # 是否启动Qt可视化窗口
SAVE_LOG_BAG = False  # 是否保存日志包

# 通信协议
FRAME_SIZE = 32
VERSION = 0x02
COMMAND_TYPES = {
    "ConnectionRequest": 0x01,
    "ConnectionResponse": 0x02,
    "PositionReport": 0x03,
    "NavigationGoal": 0x04,
    "Heartbeat": 0x05,
    "CommandAck": 0x06,
    "EmergencyStop": 0x07,
    "StatusReport": 0x08,
    "RoleAssignment": 0x09,
}
STATUS_CODES = {
    "Success": 0x00,
    "GeneralError": 0x01,
    "InvalidCommand": 0x02,
    "CRCError": 0x03,
    "Timeout": 0x04,
    "RobotBusy": 0x05,
}
ROLES = {"evader": 0x01, "pursuer": 0x02}

# 服务器配置
SERVER_IP = "0.0.0.0"
SERVER_PORT = 6001
MAX_ROBOTS = 3
ROBOT_TIMEOUT = 8.0
HEARTBEAT_INTERVAL = 2.0
NAV_GOAL_MAX_INTERVAL = 10  # 最大航点发送间隔(秒)
INF = 255

# 日志配置
LOG_LEVEL = "INFO"
LOG_FILE = "pursuit_game_server.log"

# 数据路径
DATA_ROOT = os.path.join(os.path.dirname(__file__), "datas")

# 策略配置
OBS_DIST = 4  # 观察距离
PURSUER_MODE = 1  # 信念保持模式
EVADER_MODE = 2  # 后续移动模式
